ccR.Add_Rotation(
	2, -- Player Specialization
	"CC_Hunter_MM_Solo", -- Function name
	"Levelling from 90-100", -- Description
	"CC_Hunter_MM_Talents", -- Talents button frame
	"CC_Hunter_MM_Abilities", -- Abilities button frame
	"CC_Hunter_MM_Features", -- Features button frame
	"CC_Hunter_MM_Setup" -- Setup button frame
)
function CC_Hunter_MM_Solo()
	if ccR.Player.Is.ChannelingSpell(BARRAGE) then return end

	-- Features.lua
	if ccR.Player.Is.InCombat() then
		if ccR.Var("Masters_Call") then ccR.Hunter.Masters_Call() end
		if ccR.Var("Counter_Shot") then ccR.Hunter.Counter_Shot() end
		if ccR.Var("Kill_Shot") then ccR.Hunter.Kill_Shot() end
		if ccR.Var("Mend_Pet") then ccR.Hunter.Mend_Pet() end
		if ccR.Var("Misdirection") then ccR.Hunter.Misdirection() end
	end

	if ccR.Target.Is.Attackable() then
		if ccR.Var("Pet_Attack_Target") then if ccR.Unit.TargetName("pet") ~= ccR.Target.Name() then PetAttack("target") end end
		if ccR.Player.Is.Facing("target") then
			ccR.Start_Attack()
			if ccR.Player.Is.InCombat() 
			and not ccR.Player.Is.CastingOrChanneling()
			then
				-- Rapid Fire
				if ccR.Var("Rapid_Fire") and (not ccR.Var("Rapid_Fire_OnBoss") or (ccR.Var("Rapid_Fire_OnBoss") and (ccR.Player.Is.Solo() or ccR.Target.Is.Boss()))) and ccR.Spell.Is.Ready(RAPID_FIRE) then ccR.Cast.Spell(RAPID_FIRE) end
				if ccR.Var("Dire_Beast") then ccR.Hunter.Talent.Dire_Beast() end
				if ccR.Var("Binding_Shot") then ccR.Hunter.Talent.Binding_Shot(ccR.Var("Binding_Shot_Count")) end
				if ccR.Var("Intimidation") then ccR.Hunter.Talent.Intimidation() end
				if ccR.Var("Stampede") then ccR.Hunter.Talent.Stampede() end
				if ccR.Var("Exhilaration") then ccR.Hunter.Talent.Exhilaration(ccR.Var("Exhilaration_Health")) end
			end
			-- AoE
			if (ccR.Var("AutoAoE") and not ccR.Target.Is.Boss() and ccR.Target.Count(10) >= ccR.Var("AoECount")) or ccR.Settings("ManualAoE") then
				if ccR.Spell.Is.Ready(TRAP_LAUNCHER) and not ccR.Player.Has.Buff(TRAP_LAUNCHER) then ccR.Cast.Spell(TRAP_LAUNCHER) end
				if ccR.Spell.Is.Ready(EXPLOSIVE_TRAP) and ccR.Player.Has.Buff(TRAP_LAUNCHER) then ccR.Cast.AoE(EXPLOSIVE_TRAP, "target", 40, 10) end
				if ccR.Spell.Is.Ready(ICE_TRAP) and ccR.Player.Has.Buff(TRAP_LAUNCHER) then ccR.Cast.AoE(ICE_TRAP, "target", 40, 10) end
				if ccR.Var("Barrage") then if (ccR.Var("Barrage_OnBoss") and (ccR.Player.Is.Solo() or ccR.Target.Is.Boss())) or not ccR.Var("Barrage_OnBoss") then ccR.Hunter.Talent.Barrage() end end
				if ccR.Player.Has.Talent(GLAIVE_TOSS) then ccR.Hunter.Talent.Glaive_Toss() end
				if ccR.Player.Has.Talent(POWERSHOT) then ccR.Hunter.Talent.Powershot() end
				if ccR.Spell.CanAttack(MULTI_SHOT) or ccR.Spell.CanAttack(CHIMAERA_SHOT) then
					local vOnCD = 0
					local vTalentCount = 0
					if ccR.Player.Has.Talent(GLAIVE_TOSS) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(GLAIVE_TOSS) > 1.5 then vOnCD = vOnCD + 1 end end
					if ccR.Player.Has.Talent(POWERSHOT) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(POWERSHOT) > 1.5 then vOnCD = vOnCD + 1 end end
					if ccR.Player.Has.Talent(BARRAGE) and ccR.Var("Barrage") and (not ccR.Var("Barrage_OnBoss") or (ccR.Var("Barrage_OnBoss") and (ccR.Player.Is.Solo() or ccR.Target.Is.Boss()))) then vTalentCount = vTalentCount + 1	if ccR.Spell.CooldownTime(BARRAGE) > 1.5 then vOnCD = vOnCD + 1 end end
					if vOnCD >= vTalentCount then 
						if ccR.Spell.CanAttack(CHIMAERA_SHOT) then ccR.Cast.Attack(CHIMAERA_SHOT) end
						if ccR.Spell.CanAttack(MULTI_SHOT) then ccR.Cast.Attack(MULTI_SHOT) end
					end
				end
				if ccR.Player.Has.Talent(FOCUSING_SHOT_MM) then	if ccR.Spell.CanAttack(FOCUSING_SHOT_MM) and not ccR.Player.Is.Moving() then ccR.Cast.Attack(FOCUSING_SHOT_MM) end else	if ccR.Spell.CanAttack(STEADY_SHOT) then ccR.Cast.Attack(STEADY_SHOT) end end
			return
			end

			-- Single Target
			if ccR.Target.Is.Boss()
			and (ccR.Target.Health() >= 80 or ccR.Player.Has.Buff(RAPID_FIRE))
			then
				if ccR.Player.Has.Talent(A_MURDER_OF_CROWS) then ccR.Hunter.Talent.A_Murder_of_Crows() end
				if ccR.Var("Barrage") then if (ccR.Var("Barrage_OnBoss") and (ccR.Player.Is.Solo() or ccR.Target.Is.Boss())) or not ccR.Var("Barrage_OnBoss") then ccR.Hunter.Talent.Barrage() end end
				if ccR.Spell.CanAttack(CHIMAERA_SHOT) then ccR.Cast.Attack(CHIMAERA_SHOT) end
				if ccR.Spell.CanAttack(AIMED_SHOT) and ccR.Player.Has.Buff(THRILL_OF_THE_HUNT) then ccR.Cast.Attack(AIMED_SHOT) end
				if ccR.Spell.CanAttack(AIMED_SHOT) then
					local vOnCD = 0
					local vTalentCount = 0
					if ccR.Player.Has.Talent(A_MURDER_OF_CROWS) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(A_MURDER_OF_CROWS) > 1.5 then vOnCD = vOnCD + 1 end end
					if ccR.Player.Has.Talent(BARRAGE) and ccR.Var("Barrage") and (not ccR.Var("Barrage_OnBoss") or (ccR.Var("Barrage_OnBoss") and (ccR.Player.Is.Solo() or ccR.Target.Is.Boss()))) then vTalentCount = vTalentCount + 1	if ccR.Spell.CooldownTime(BARRAGE) > 1.5 then vOnCD = vOnCD + 1 end end
					if vOnCD >= vTalentCount then ccR.Cast.Attack(AIMED_SHOT) end
				end
				if ccR.Player.Has.Talent(FOCUSING_SHOT_MM) then	if ccR.Spell.CanAttack(FOCUSING_SHOT_MM) and not ccR.Player.Is.Moving() then ccR.CastAttack(FOCUSING_SHOT_MM) end else	if ccR.Spell.CanAttack(STEADY_SHOT) then ccR.CastAttack(STEADY_SHOT) end end
			else
				if ccR.Player.Has.Talent(A_MURDER_OF_CROWS) then ccR.Hunter.Talent.A_Murder_of_Crows() end
				if ccR.Var("Barrage") then if (ccR.Var("Barrage_OnBoss") and (ccR.Player.Is.Solo() or ccR.Target.Is.Boss())) or not ccR.Var("Barrage_OnBoss") then ccR.Hunter.Talent.Barrage() end	end
				if ccR.Player.Has.Talent(POWERSHOT) then ccR.Hunter.Talent.Powershot() end
				if ccR.Player.Has.Talent(GLAIVE_TOSS) then ccR.Hunter.Talent.Glaive_Toss() end
				if ccR.Spell.CanAttack(CHIMAERA_SHOT) then ccR.Cast.Attack(CHIMAERA_SHOT) end
				if ccR.Spell.CanAttack(AIMED_SHOT) and ccR.Player.Has.Buff(THRILL_OF_THE_HUNT) then ccR.Cast.Attack(AIMED_SHOT) end
				if ccR.Spell.CanAttack(AIMED_SHOT) then
					local vOnCD = 0
					local vTalentCount = 0
					if ccR.Player.Has.Talent(A_MURDER_OF_CROWS) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(A_MURDER_OF_CROWS) > 1.5 then vOnCD = vOnCD + 1 end end
					if ccR.Player.Has.Talent(GLAIVE_TOSS) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(GLAIVE_TOSS) > 1.5 then vOnCD = vOnCD + 1 end end
					if ccR.Player.Has.Talent(POWERSHOT) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(POWERSHOT) > 1.5 then vOnCD = vOnCD + 1 end end
					if ccR.Player.Has.Talent(BARRAGE) and ccR.Var("Barrage") and (not ccR.Var("Barrage_OnBoss") or (ccR.Var("Barrage_OnBoss") and (ccR.Player.Is.Solo() or ccR.Target.Is.Boss()))) then vTalentCount = vTalentCount + 1	if ccR.Spell.CooldownTime(BARRAGE) > 1.5 then vOnCD = vOnCD + 1 end end
					if vOnCD >= vTalentCount then ccR.Cast.Attack(AIMED_SHOT) end
				end
				if ccR.Player.Has.Talent(FOCUSING_SHOT_MM) then	if ccR.Spell.CanAttack(FOCUSING_SHOT_MM) and not ccR.Player.Is.Moving() then ccR.Cast.Attack(FOCUSING_SHOT_MM) end else	if ccR.Spell.CanAttack(STEADY_SHOT) then ccR.Cast.Attack(STEADY_SHOT) end end
			end
		end
	end

end